<?php

namespace Beerus\Modules\Extend\Controllers;

use App\Http\Controllers\Controller;
use Doraemon\service\Tag as sTag;

/**
 * description
 *
 * @category   Module name
 * @package    PSR
 * @subpackage Documentation\API
 * @author     zhouyang  <zhouyang@haohaozhu.com>
 * @license    GPL http://www.haohaozhu.com
 * @link       http://www.haohaozhu.com
 */

class TagController extends Controller
{
    public function allList()
    {
        $tags = sTag::getTagList();
        $tags = array_map(function ($tag) {
            return [
                "id" => $tag["id"],
                "text" => $tag["tag"]
            ];
        }, $tags);

        return response()->json($tags);
    }
}
